<template>
	<view class="">
		<view class="audit" v-for="(item,index) in auditList" :key='index'>
			<view class="wrapper" @tap.stop="auditDetail(item.id)" >
				<view class="cell-header">
					<view>
						{{item.name}}
					</view>
					<view class="right_cell">
						<view>
							<text v-if='typeID==1' class="blue">待审核</text>
							<text v-if='typeID==2' class="red">未通过</text>
							<text v-if='typeID==3' class="green">已通过</text>
						</view>
						 <view class="">
						 	<uni-icons type="arrowright" color="#bbbbbb" size="20" />
						 </view>
					</view>
				</view>
				
				<view class="cell-content">
					<view class="organAddress">
						<view class="">
							<text>申请机构:</text>
							<text>{{item.orgName}}</text>
						</view>
						<view class="society red" v-if="item.type==1">
							未授权
						</view>
						<view class="society green" v-if="item.type==2">
							已授权
						</view>
						<view class="province_plan" v-if="item.isPlan===1">
							省级计划
						</view>
						<view class="no_province_plan" v-if="item.isPlan==0">
							非省级计划
						</view>
					</view>
					<view class="organnum">
						<text>赛事规模:</text>
						<text>{{item.rank}}</text>
					</view>
					<view class="organtime" v-if="item.gameTime[0]">
						<text>比赛时间:</text>
						<text>{{showTime(item.gameTime[0])+' 至 '+showTime(item.gameTime[1])}}</text>
					</view>
					<view class="organtime" v-if="item.applyTime[0]">
						<text>比赛时间:</text>
						<text>{{showTime(item.applyTime[0])+' 至 '+showTime(item.applyTime[1])}}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import uniIcons from '@/components/uni-icons/uni-icons.vue'
	export default{
		props:{
			auditList:Array,
			typeID:String
		},
		data(){
			return{
				
			}
		},
		components:{
			uniIcons
		},
		methods:{
			showTime (e) {
			  if (e !== null) {
			    return e.substring(0, 10)
			  } else {
			    return false
			  }
			},
			auditDetail(id){
				var _this=this;
				console.log(id)
				_this.$emit('toAuditDetail',id)
			},
		}
	}
</script>

<style lang='less' scoped>
	.audit{
		padding: 0;
		margin: 0;
		background: #fff;
		margin-top:20rpx ;
		padding: 18rpx 0;
		.wrapper{
			padding: 0 20rpx;
		}
	}
	.blue{
		color: #2D8DFF;
	}
	.red{
		color:#FF535A;
	}
	.green{
		color: #81D25A;
	}
	.cell-header{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		border-bottom: 2rpx solid #F6F7F9;
		padding-bottom:16rpx ;
		.right_cell{
			display: flex;
			flex-direction: row;
			align-items: center;
		}
		view:first-child{
			font-size: 32rpx;
			width: 80%;
			align-self: center;
			max-height: 105rpx;
			overflow: hidden;
		}
		view:last-child{
			width: 20%;
			text-align: right;
			color: red;
			font-size: 24rpx;
			align-self: center;
		}
	}
	.cell-content{
		padding: 4rpx 0;
		font-size: 28rpx;
		>view{
			margin-top: 20rpx;
			text:last-child{
				margin-left: 18rpx;
			}
		}
		.organAddress{
			display: flex;
			flex-direction: row;
			view{
				margin-left: 18rpx;
			}
			view:first-child{
				margin-left: 0;
			}
			.province_plan{
				font-size: 20rpx;
				padding: 0 6rpx;
				background: #409eff;
				color: #fff;
				border-radius:4rpx;
				height: 40rpx;
				align-self: center;
				line-height: 40rpx;
			}
			.no_province_plan{
				font-size: 20rpx;
				padding: 0 5rpx;
				background: #FFC265;
				color: #fff;
				border-radius:4rpx;
				height: 40rpx;
				align-self: center;
				line-height: 40rpx;
			}
			.blue{
				color: #2D8DFF;
			}
			.red{
				background:#FF535A;
				color: #fff;
			}
			.green{
				background: #81D25A;
				color: #fff;
			}
			.society{
				font-size: 20rpx;
				padding: 0 6rpx;
				border-radius:4rpx;
				height: 40rpx;
				align-self: center;
				line-height: 40rpx;
				/* background: #2D8DFF; */
				/* color: #fff; */
			}
		}
	}
</style>
